﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ExiaWorkshopServicesE3
{
    class Program
    {
        delegate void MyDelegateType();
        static int compteurSecondes = 0;

        static void Main(string[] args)
        {
            MyDelegateType myDelegateInstance = new MyDelegateType(compteur);

            Thread myThread = new Thread(myDelegateInstance.Invoke);
            //Thread myThread = new Thread(compteur);
            myThread.Start();
            Console.ReadLine();
        }

        public static void compteur()
        {
            while (true)
            {
                Console.Clear();
                Console.WriteLine(compteurSecondes);
                compteurSecondes++;

                Thread.Sleep(1000);
            }
        }
    }
}
